﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SharingCenter.Web.Classes;
using SharingCenter.Web.Classes.Message;

namespace SharingCenter.Web.User.CurrentProfile
{
    public partial class Security : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ChangePassword1.ChangedPassword += new EventHandler(ChangePassword1_ChangedPassword);
        }

        void ChangePassword1_ChangedPassword(object sender, EventArgs e)
        {
            Profile.Security.PasswordReset = false;

            Dictionary<string, string> rep = new Dictionary<string, string>();
            rep.Add("NickName", Profile.Personal.NickName);
            rep.Add("Password", ChangePassword1.NewPassword);
            rep.Add("UserName", HttpContext.Current.User.Identity.Name);

            MailOperations.SendSystemMail("Account", "ChangePassword", HttpContext.Current.User.Identity.Name, rep);
        }
    }
}
